import { defHttp } from "@/utils/http";

// 设备试用 VO
export interface EqpNewtriesVO {
	pkId: string; // 试用ID
	eqpId: string; // 设备ID
	assprId: string; // 评估人ID
	asseDtimeFrom: Date; // 试用起始时间
	asseDtimeTo: Date; // 试用结束时间
	processId: string; // 流程实例ID
	status: string; // 状态
	createdBy: string; // 创建人
	createdTime: Date; // 创建时间
	updatedBy: string; // 更新人
	updatedTime: Date; // 更新时间
}

// 设备试用 API
export const EqpNewtriesApi = {
	// 查询设备试用分页
	getEqpNewtriesPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/eqp-newtries/page`, params });
	},

	// 查询设备试用详情
	getEqpNewtries: async (id: number) => {
		return await defHttp.get({ url: `/whs/eqp-newtries/get?id=` + id });
	},

	// 新增设备试用
	createEqpNewtries: async (data: EqpNewtriesVO) => {
		return await defHttp.post({ url: `/whs/eqp-newtries/create`, data });
	},

	// 修改设备试用
	updateEqpNewtries: async (data: EqpNewtriesVO) => {
		return await defHttp.put({ url: `/whs/eqp-newtries/update`, data });
	},

	// 删除设备试用
	deleteEqpNewtries: async (id: number) => {
		return await defHttp.delete({ url: `/whs/eqp-newtries/delete?id=` + id });
	},

	// 导出设备试用 Excel
	exportEqpNewtries: async (params: any) => {
		return await defHttp.download({ url: `/whs/eqp-newtries/export-excel`, params });
	}
};
